{include file="common/meta" /}
<style>
    .content{
        width: 90%;
        margin: 0 auto;
    }
    .font{
        text-align: left !important;
    }
</style>
<title>我的订单</title>
    <link href="../css/WeUI/weui.min.css" rel="stylesheet" />
<link href="/assets/home/css/MyCenter.css" rel="stylesheet" />

    <div class="top_div">
        <img src="/assets/home/images/bac.jpg" class="top_img">
        <div class="userInfo">
            {if condition = "$business.avatar"}
            <img class="uPic" src="{$business['avatar']}" /><br />
            {else /}
            <img class="uPic" src="/assets/home/images/avatar.jpg" /><br />
            {/if}
            
            <span class="uBalance" style="color: rgb(74, 70, 66); ">{$business.nickname}</span>
        </div>
    </div>
    <div class="page__bd" style="height: 100%;">
        <div class="weui-tab">
            <div class="weui-navbar">
                <div class="weui-navbar__item weui-bar__item_on">
                    视频购买记录
                </div>

                <div class="weui-navbar__item">
                   消费记录
                </div>


            </div>
            <div class="weui-tab__panel">
                <div id="o1">
                    {if condition="$Orderlist"}
                    {foreach $Orderlist as $orders}
                     <div class="weui-form-preview">
                         <div class="weui-form-preview__hd">
                             <div class="weui-form-preview__item">
                                 <label class="weui-form-preview__label">订单金额</label>
                                 <em class="weui-form-preview__value">¥{$orders['total']}</em>
                             </div>
                         </div>
                         <div class="weui-form-preview__bd">
                             <div class="weui-form-preview__item">
                                 <label class="weui-form-preview__label">课程名称</label>
                                 <span class="weui-form-preview__value">{$orders['subject']['title']}</span>
                             </div>
                             <div class="weui-form-preview__item">
                                 <label class="weui-form-preview__label">购买时间</label>
                                 <span class="weui-form-preview__value">{$orders['createtime']}</span>
                             </div>
                             <div class="weui-form-preview__item">
                                 <label class="weui-form-preview__label">课程简介</label>
                                 <span class="weui-form-preview__value" style="white-space: nowrap;text-overflow: ellipsis;">{$orders['subject']['content_text']}</span>
                             </div>
                         </div>
                         <div class="weui-form-preview__ft">
                            <!-- 判断是否有没有评论 -->
                            {if condition="$orders['commentstate']"}
                            <div class="weui-form-preview__btn weui-form-preview__btn_default">已评价</div>
                            {else /}
                            <a class="weui-form-preview__btn weui-form-preview__btn_default" href="{:url('/home/user/subject/comment',['cid' => $orders['subid']])}">评价</a>
                            {/if}
                          
                            <a class="weui-form-preview__btn weui-form-preview__btn_primary" href="{:url('/home/user/subject/details',['cid' => $orders['subid']])}">立即查看</a>
                        </div>
                     </div><br />
                     {/foreach}
                     {else /}
                     <div class="weui-form-preview">
                         暂无课程订单
                     </div>
                     <br />
                     {/if}
                 </div>


               

                <div id="o2" style="display:none;">
                    <br />
                    {if condition="$Recordlist"}
                    {foreach $Recordlist as  $item}
                    <div class="weui-form-preview">
                        <div class="weui-form-preview__hd">
                            <div class="weui-form-preview__item">
                                <label class="weui-form-preview__label">消费金额</label>
                                <em class="weui-form-preview__value">¥{$item['total']}</em>
                            </div>
                        </div>
                        <div class="weui-form-preview__bd">
                            <div class="weui-form-preview__item">
                                <label class="weui-form-preview__label">消费描述</label>
                                <span class="weui-form-preview__value">{$item['content']}</span>
                            </div>
                            <div class="weui-form-preview__item">
                                <label class="weui-form-preview__label">消费时间</label>
                                <span class="weui-form-preview__value">{$item['createtime']}</span>
                            </div>
                        </div>
                    </div>
                    <br />
                    {/foreach}
                    {else /}
                    <div class="weui-form-preview">
                        暂无消费记录
                    </div>
                    {/if}
                    <br />
                </div>


                
            </div>
        </div>
    </div>
    <script src="/assets/home/js/jquery-1.9.1.min.js"></script>
     <script>
         $(function () {
             $('.weui-navbar__item').on('click', function () {
                 $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
                 if ($('#o2').is(":hidden")) {
                     $('#o2').show();
                     $('#o1').hide();
                 } else {
                     $('#o2').hide();
                     $('#o1').show();
                 }
             });
         });
     </script>
